package xsxdjc
public class JueCeLiu3{
	public static Closure rule = {_context_ ->
		HashMap _result_ = new HashMap();
		_result_.rname = '决策流3';
		_result_.rpath = 'xsxdjc/JueCeLiu3';
		
		Map<Integer,Map> _stateMachine_ =[
			1:[itemType:'start',
				action:{},
				nextStateId:2,
			],
			2:[itemType:'end',
				action:{},
				nextStateId:0,
			],
		];
		def _node_ = _stateMachine_[1];//the start node
		while(_node_.itemType != 'end')
		{
			if(_node_.itemType in ['task','start'])
			{
				_node_.action();
				_node_ = _stateMachine_[_node_.nextStateId];
			}
			else if(_node_.itemType == 'switch')
			{
				_node_ = _stateMachine_[_node_.nextStateId[_node_.action().clas.id]];
			}
			else assert false;
		}
		_result_.rets = [:];
		
		return _result_;
	};
};